<#assign isFluentValid = isFluentValid!true/>
package ${package};

<#if imports??>
    <#list imports as import>
import ${import};
    </#list>
</#if>
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import ${parent + ".util.BeanUtil"};
import ${parent + ".dao." + property + "Mapper"};
import ${parent + ".service." + property + "Service"};
import ${parent + ".entity.po." + property};
import ${parent + ".entity.vo." + property + "VO"};
<#if isFluentValid>
import com.baidu.unbiz.fluentvalidator.annotation.FluentValid;
</#if>

/**
 * ${(remarks=='')?string(name, remarks)} service
 * @author ${author}
 * @date ${.now?string("yyyy/MM/dd HH:mm:ss")}
 * @version V1.0
 */
@Service
public class ${property}ServiceImpl implements ${property}Service{

	private Logger logger = LoggerFactory.getLogger(${property}ServiceImpl.class);

    @Autowired
    private ${property}Mapper mapper;

    @Override
    public int save(${isFluentValid?string('@FluentValid(groups = Add.class) ', ' ')}${property} r) {
    	logger.info("${property}ServiceImpl.save param: r is {}", r);
        return mapper.insert(r);
    }

    @Override
    public int delete(${property} r) {
        logger.info("${property}ServiceImpl.delete param: r is {}", r);
        return mapper.delete(r);
    }

    <#if primary??>
    @Override
    public int deleteById(${primary.classType} id) {
    	logger.info("${property}ServiceImpl.deleteById param: id is {}", id);
        return mapper.deleteById(id);
    }

    @Override
    public ${property} selectById(${primary.classType} id) {
    	logger.info("${property}ServiceImpl.selectById param: id is {}", id);
        return mapper.selectById(id);
    }

    @Override
    public int update(${isFluentValid?string('@FluentValid(groups = Update.class) ', ' ')}${property} r) {
    	logger.info("${property}ServiceImpl.update param: r is {}", r);
        return mapper.update(entity);
    }
    </#if>

    @Override
    public List<${property + 'VO'}> list(${property} r) {
    	logger.info("${property}ServiceImpl.list param: r is {}", r);
        return mapper.list(r);
    }
}
